<template>
	<view class="bg">
		<view class="search-container">
			<view class="search">
				<input class="ipt" type="text" placeholder="请输入搜索关键字" v-model="keyword" @focus="search">
			</view>
			<view class="submit" @click="search">
				<text>搜索</text>
			</view>
		</view>
		<slot name="content"></slot>
	</view>
</template>

<script>
	export default {
		name: "Search",
		data() {
			return {
				keyword: ''
			};
		},
		methods: {
			search() {
				uni.navigateTo({
					url: '/pages/search/search'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		height: 500rpx;
		padding: 0 10rpx;
		position: relative;
		background-image: url('@/static/image/main.png');
		background-repeat: no-repeat;
		background-size: 100% 90%;
		padding-top: 20rpx;

		.search-container {
			height: 70rpx;
			background-color: #fff;
			border-radius: 999rpx;
			padding: 0 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.search {
				padding-left: 10rpx;
				flex: 1;

				.ipt {
					font-size: 24rpx;
					color: #000;
				}
			}

			.submit {
				background-color: #FC5E14;
				color: #fff;
				font-size: 24rpx;
				line-height: 50rpx;
				padding: 0 30rpx;
				border-radius: 999rpx;
			}
		}

	}
</style>
